/**
 * 
 */
package com.kingcore.pda.core.util;

import java.io.UnsupportedEncodingException;

/**
 * @author Zeven
 *
 */
public class DebugUtil {


	public static void testEncoding(String str) {

    	try {
			System.out.println("file.encoding is " + System.getProperty("file.encoding") );
			System.out.println("gbk-->utf-8 " + new String(str.getBytes("gbk"), "utf-8") );

			System.out.println("utf-8-->gbk " + new String(str.getBytes("utf-8"),"gbk") );
			System.out.println("utf-8-->iso8859-1 " + new String(str.getBytes("utf-8"),"iso8859-1") );
			System.out.println("gbk-->utf-8 " + new String(str.getBytes("gbk"),"utf-8") );
			System.out.println("gbk-->iso8859-1 " + new String(str.getBytes("gbk"),"iso8859-1") );

			System.out.println("gbk-->gbk " + new String(str.getBytes("gbk"), "gbk") );
			System.out.println("utf-8-->utf-8 " + new String(str.getBytes("utf-8"), "utf-8") );

			System.out.println("iso8859-1-->utf-8 " + new String(str.getBytes("iso8859-1"),"utf-8") );
			System.out.println("iso8859-1-->gbk " + new String(str.getBytes("iso8859-1"),"gbk") );
			System.out.println("java.net.URLEncoder " + java.net.URLDecoder.decode(str,"utf-8") );
			
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
